/*
 * @Author: 抱着羊啃 1437670973@qq.com
 * @Date: 2025-10-24 08:23:14
 * @LastEditors: 抱着羊啃 1437670973@qq.com
 * @LastEditTime: 2025-10-26 19:07:42
 * @FilePath: \fall-guard-band\src\main\java\com\example\fall_guard_band\controller\NursingHomeController.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package com.example.fall_guard_band.controller;

import com.example.fall_guard_band.pojo.result.Result;
import com.example.fall_guard_band.pojo.vo.NursingHomeSimpleVO;
import com.example.fall_guard_band.service.NursingHomeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/nursing_home")
@Slf4j
@RequiredArgsConstructor
public class NursingHomeController {

    private final NursingHomeService nursingHomeService;

    @GetMapping("/list")
    public Result<List<NursingHomeSimpleVO>> listAll() {
        List<NursingHomeSimpleVO> homes = nursingHomeService.listAllHomes();
        return Result.success(homes);
    }
}
